Repository navigation
fix: reload list after workflow action - #204
Open
amadulhaxxani wants to merge 1 commit into
Open
amadulhaxxani wants to merge 1 commit into
amadulhaxxani wants to merge 1 commit into
Conversation
re-run the search without cache on contentChange so the count adn the next workflow task show up right after claim/approve/reject
There was a problem hiding this comment.
🟡 Changes recommended
Approving a task can leave users on an empty page without pagination controls, while cached search variants can restore stale results and totals.
2 open issues
What changed in this PR
This PR updates the shared search component to reload MyDSpace task lists and counts after claim, approve, or reject actions.
Changes:
- Re-runs searches without cached results when content changes, alongside the existing filter refresh.
- Preserves normal search caching and adds two unit tests covering cache behavior and refresh notifications.
| File | Description |
|---|---|
src/app/shared/search/search.component.ts |
Adds result reloading on content changes and an optional cache override. |
src/app/shared/search/search.component.spec.ts |
Tests normal cache reuse and cache bypass after content changes. |
Review effort: Balanced
| * @param $event | ||
| */ | ||
| public onContentChange($event: any) { | ||
| this.retrieveSearchResults(this.lastSearchOptions, false); |
| * @param $event | ||
| */ | ||
| public onContentChange($event: any) { | ||
| this.retrieveSearchResults(this.lastSearchOptions, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem description
After a workflow action in MyDSpace (claim/approve/reject), the list is not refreshed. After the final approve the count stays wrong (e.g. "1-7 of 7" while the server has 6), and after approving a step only the "Approved" card is shown, the next task appears only after leaving the page and coming back.
Analysis
After an action only that one row is swapped and
contentChangeis emitted.SearchComponent.onContentChangere-fetched only the filters, never the results, so the count and new tasks stayed stale. The fix re-runs the search withuseCachedVersionIfAvailable = falseinonContentChange.retrieveSearchResultsgot an optional parameter that defaults to the old value, so other searches are unaffected. Added 2 unit tests insearch.component.spec.ts.Note: the "Approved"/"Declined" card is now replaced by the reloaded list, the success toast still shows.
Sync verification
N/A — no
.json5files changed.Copilot review